﻿<Window x:Class="TFlic.View.Popup.CreateBoardPopup"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:TFlic.View.Popup"
        xmlns:vm="clr-namespace:TFlic.ViewModel"
        mc:Ignorable="d"
        
        Title="CreateColumnPopup" Height="200" Width="500"
        WindowStyle="None"
        WindowStartupLocation="CenterScreen"
        Background="Transparent"
        AllowsTransparency="True"
        ResizeMode="NoResize"
        MouseDown="Window_MouseDown">
    
    <Window.Resources>
        <SolidColorBrush x:Key="TextBox.Static.Border" Color="#FFABAdB3"/>
        <SolidColorBrush x:Key="TextBox.MouseOver.Border" Color="#FF7EB4EA"/>
        <SolidColorBrush x:Key="TextBox.Focus.Border" Color="#FF569DE5"/>
        <Style x:Key="TextBoxStyleCB" TargetType="{x:Type TextBox}">
            <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"/>
            <Setter Property="BorderBrush" Value="{StaticResource TextBox.Static.Border}"/>
            <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
            <Setter Property="BorderThickness" Value="1"/>
            <Setter Property="KeyboardNavigation.TabNavigation" Value="None"/>
            <Setter Property="HorizontalContentAlignment" Value="Left"/>
            <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
            <Setter Property="AllowDrop" Value="true"/>
            <Setter Property="ScrollViewer.PanningMode" Value="VerticalFirst"/>
            <Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type TextBox}">
                        <Border x:Name="border" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="True" CornerRadius="9">
                            <ScrollViewer x:Name="PART_ContentHost" Focusable="false" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden"/>
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsEnabled" Value="false">
                                <Setter Property="Opacity" TargetName="border" Value="0.56"/>
                            </Trigger>
                            <Trigger Property="IsMouseOver" Value="true">
                                <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource TextBox.MouseOver.Border}"/>
                            </Trigger>
                            <Trigger Property="IsKeyboardFocused" Value="true">
                                <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource TextBox.Focus.Border}"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
            <Style.Triggers>
                <MultiTrigger>
                    <MultiTrigger.Conditions>
                        <Condition Property="IsInactiveSelectionHighlightEnabled" Value="true"/>
                        <Condition Property="IsSelectionActive" Value="false"/>
                    </MultiTrigger.Conditions>
                    <Setter Property="SelectionBrush" Value="{DynamicResource {x:Static SystemColors.InactiveSelectionHighlightBrushKey}}"/>
                </MultiTrigger>
            </Style.Triggers>
        </Style>
    </Window.Resources>

    <Window.DataContext>
        <vm:OrganizationWindowViewModel/>
    </Window.DataContext>

    <Border CornerRadius="15">
        <Border CornerRadius="15"
            BorderThickness="5"
            Opacity="1">

            <Border.BorderBrush>
                <SolidColorBrush Color="#565656" Opacity="1"/>
            </Border.BorderBrush>
            <Border.Background>
                <LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
                    <GradientStop Color="#5F5F5F" Offset="0"/>
                    <GradientStop Color="#6A6A6A" Offset="0.25"/>
                    <GradientStop Color="#8E8E8E" Offset="0.5"/>
                    <GradientStop Color="#6A6A6A" Offset="0.75"/>
                    <GradientStop Color="#5F5F5F" Offset="1"/>
                </LinearGradientBrush>
            </Border.Background>

            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="25"/>
                    <RowDefinition/>
                </Grid.RowDefinitions>

                <Grid Grid.Row="0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition />
                        <ColumnDefinition Width="25"/>
                    </Grid.ColumnDefinitions>

                    <TextBlock Text="Создание доски"
                       FontSize="20"
                       Grid.Column="0"
                       VerticalAlignment="Center"
                       HorizontalAlignment="Center"
                       Margin="10,0,0,0"/>

                    <Button x:Name="BClose"  
                            Grid.Column="3" 
                            Click="BClose_Click"
                            Style="{DynamicResource CloseWindowButtonStyle}"
                            Template="{DynamicResource CloseWindowButtonTemplate}" Cursor="Arrow"/>
                </Grid>

                <Grid Grid.Row="1">

                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="100"/>
                        <ColumnDefinition/>
                        <ColumnDefinition Width="100"/>
                    </Grid.ColumnDefinitions>

                    <StackPanel Grid.Column="1"
                                Margin="0,50,0,50">

                        <TextBlock Text="Название" 
                                   FontSize="12" 
                                   FontWeight="Medium" 
                                   Margin="0,0,0,0"/>
                        <TextBox Style="{DynamicResource TextBoxStyleCB}" Grid.Column="1"
                             Text="{Binding BoardName, UpdateSourceTrigger=PropertyChanged}"/>

                        <!-- <TextBlock Text="Описание" 
                                   FontSize="12" 
                                   FontWeight="Medium" 
                                   Margin="0,10,0,0"/>
                        <TextBox Grid.Column="1"
                                 Height="50"
                                 Margin="0,0,0,0"
                             Text="{Binding ProjectDesc, UpdateSourceTrigger=PropertyChanged}"/> -->

                        <Button Name="Create"
                                Content="Создать"
                                Margin="0,10,0,0"
                                Width="200"
                                Style="{DynamicResource ButtonStyle}"
                                Template="{DynamicResource ButtonTemplate}"
                                Command="{Binding AddBoardCommand}"
                                Click="Create_Click"/>

                    </StackPanel>
                </Grid>
            </Grid>
        </Border>
    </Border>
</Window>
